/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 *
 * syscall_wrapper.h - liblinux specific wrappers to syscall definitions
 * Liblinux does not need to generate compat syscalls and each syscall is exproted
 */

#ifndef __ASM_SYSCALL_WRAPPER_H
#define __ASM_SYSCALL_WRAPPER_H

#define SYSCALL_EXPORT_SYMBOL(name)    EXPORT_SYMBOL_GPL(sys##name)

/*
 * currently we do not need to support __arm64 syscall which takes pt_regs pointer as parameter
 */
#define __SYSCALL_DEFINEx(x, name, ...)					\
	asmlinkage long sys##name(__MAP(x, __SC_DECL, __VA_ARGS__));	\
	SYSCALL_EXPORT_SYMBOL(name);			\
	asmlinkage long sys##name(__MAP(x, __SC_DECL, __VA_ARGS__))

#define SYSCALL_DEFINE0(sname)					\
	SYSCALL_METADATA(_##sname, 0);				\
	asmlinkage long sys_##sname(void);			\
	SYSCALL_EXPORT_SYMBOL(_##sname);			\
	asmlinkage long sys_##sname(void)

/* declarations for syscalls */

#endif /* __ASM_SYSCALL_WRAPPER_H */
